﻿Public Class GestionGeneral

    Private Sub b_ClienteAnimal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_ClienteAnimal.Click
        ClientesAnimales.Show()
        Me.Hide()
    End Sub

    Private Sub b_Busqueda_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_Busqueda.Click
        BusquedaClientesAnimales.Show()
        Me.Hide()
    End Sub

    Private Sub b_Cita_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_Cita.Click
        PedirCita.Show()
        Me.Hide()
    End Sub

    Private Sub b_Venta_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_Venta.Click
        Ventas.Show()
        Me.Hide()
    End Sub

    Private Sub b_GestionEmp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_GestionEmp.Click
        Empleados.Show()
        Me.Hide()
    End Sub

    Private Sub b_VacunEnf_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_VacunEnf.Click
        VacunasEnfermedadesOperaciones.Show()
        Me.Hide()
    End Sub

    Private Sub b_consultas_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_consultas.Click
        Consultas.Show()
        Me.Hide()
    End Sub

    Private Sub GestionGeneral_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        'iniciar ayuda dando a f1
        If e.KeyCode = 112 Then
            Help.ShowHelp(Me, HelpProvider1.HelpNamespace)
        End If
    End Sub


    Private Sub GestionGeneral_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        lab_Usuario.Text = Bienvenida.usuario
        If lab_Usuario.Text <> "admin" Then
            lab_gestanimcli.Hide()
            b_ClienteAnimal.Hide()
            lab_gestcons.Hide()
            b_consultas.Hide()
            lab_gestemp.Hide()
            b_GestionEmp.Hide()
            lab_gestprodudistri.Hide()
            b_Productos.Hide()
            lab_gestvacun.Hide()
            b_VacunEnf.Hide()
        End If
    End Sub

    Private Sub b_Productos_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_Productos.Click
        ProductosDistribuidores.Show()
        Me.Hide()
    End Sub

    Private Sub CerrarSesionToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CerrarSesionToolStripMenuItem.Click
        Bienvenida.usuario = ""
        Bienvenida.Show()
        Me.Close()
    End Sub

    Private Sub b_adopciones_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_adopciones.Click
        Adopciones.Show()
        Me.Hide()
    End Sub

    Private Sub AyudaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AyudaToolStripMenuItem.Click
        Help.ShowHelp(Me, HelpProvider1.HelpNamespace)
    End Sub

    Private Sub TercerosToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TercerosToolStripMenuItem.Click
        Terceros.Show()
        Me.Hide()
    End Sub

    'metodos del notify icon
    Private Sub minimizar()
        Me.WindowState = FormWindowState.Minimized
        If Me.WindowState = FormWindowState.Minimized Then
            Hide()
            NotifyIcon1.Visible = True
            NotifyIcon1.ShowBalloonTip("3000", "Información", "La aplicación se está ejecutando en segundo plano", ToolTipIcon.Info)
        End If
    End Sub

    Private Sub SegundoPlanoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SegundoPlanoToolStripMenuItem.Click
        minimizar()
    End Sub

    Private Sub RestaurarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestaurarToolStripMenuItem.Click
        Me.Show()
        Me.WindowState = FormWindowState.Normal
    End Sub
End Class